import { _decorator, Component, Node } from 'cc';
import { Message, MessageCmd, MessageType } from '../message/Message';
import { MessageCenter } from '../message/MessageCenter';
const { ccclass, property } = _decorator;

@ccclass('Player')
export class Player extends Component {
    score = 0;

    start() {

        this.node.on(Node.EventType.TOUCH_START,()=>{
            var message = new Message(MessageType.TypeUI,MessageCmd.CmdHP,this.score++);

            console.log(message);
            
            MessageCenter.instance.sendMessage(message);
        });

    }

    update(deltaTime: number) {
        
    }
}

